package alogcore

// Tracer the trace ID interface
type Tracer interface {
	GetValue() string
	alogTraceTag()
}

// TraceIDKey trace ID will write to log
type jaegerTraceIDKey string

// JaegerTraceID the traceID
var JaegerTraceID jaegerTraceIDKey = "x-jaeger-trace-id-galileo"

// GetValue Get TraceIDKey string value
func (t jaegerTraceIDKey) GetValue() string {
	return string(t)
}

func (t jaegerTraceIDKey) alogTraceTag() {}

// Eagle eye trace ID, it come from force
type eagleEyeTraceIDKey string

// EagleEyeTraceID the eagle eye traceID
var EagleEyeTraceID eagleEyeTraceIDKey = "x-eagle-eye-trace-id"

// GetValue get EagleEyeTraceID string value
func (e eagleEyeTraceIDKey) GetValue() string {
	return string(e)
}

func (e eagleEyeTraceIDKey) alogTraceTag() {}

type galileoSubTraceIDKey string

// GalileoSubTraceID the galileo sub trace id, it will be use in galileo method trace
var GalileoSubTraceID galileoSubTraceIDKey = "x-galileo-sub-trace-id"

// GetValue get GalileoSubTraceID string value
func (g galileoSubTraceIDKey) GetValue() string {
	return string(g)
}

func (g galileoSubTraceIDKey) alogTraceTag() {}

type commonTraceIDKey string

// CommonTraceID the common trace id, it will be use in galileo method trace
var CommonTraceID commonTraceIDKey = "X-Trace-Id"

// GetValue get GalileoSubTraceID string value
func (c commonTraceIDKey) GetValue() string {
	return string(c)
}

func (c commonTraceIDKey) alogTraceTag() {}

// GetSupportTraceIDs get the trace IDs from alog support
func GetSupportTraceIDs() []Tracer {
	return []Tracer{
		// The eagle eye trace ID, comes form top system, such as
		// codeup, force etc...
		EagleEyeTraceID,

		// The Jaeger trace ID, comes from sshd and https.
		JaegerTraceID,

		// The sub trace id for galileo.
		GalileoSubTraceID,

		// The common trace id, it will be use in galileo method trace
		CommonTraceID,
	}
}
